package com.example.finance_manager.pages.manage;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import com.example.finance_manager.R;
import com.example.finance_manager.pages.my.*;

public class DataManageActivity extends AppCompatActivity {

    private Button btnIncome;
    private Button btnPayout;
    private Button btnFlag;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_data_manage);

        initView();
        initListener();
    }

    private void initView() {
        btnIncome = (Button) findViewById(R.id.btn_manage_income);
        btnPayout = (Button) findViewById(R.id.btn_manage_payout);
        btnFlag = (Button) findViewById(R.id.btn_manage_flag);
    }

    private void initListener() {
        btnIncome.setOnClickListener(view -> {
            to(MyIncomeActivity.class);
        });
        btnPayout.setOnClickListener(view -> {
            to(MyExpendActivity.class);
        });
        btnFlag.setOnClickListener(view -> {
            to(FlagManageActivity.class);
        });
    }

    private void to(Class<?> c) {
        Intent intent = new Intent(DataManageActivity.this, c);
        startActivity(intent);
    }

}